import Vue from 'vue'
import Router from 'vue-router'
const Login = () => import('@/views/login')
const Home = () => import('@/views/index')
const User = () => import('@/views/user')
const Workbench = () => import('@/views/main')
const Scatterplot = () => import('@/views/map/Scatterplot')
const Aggregategraph = () => import('@/views/map/Aggregategraph')
const division = () => import('@/views/map/division')
const protocol = () => import('@/views/device/protocol')
const contract = () => import('@/views/device/contract')
const salesEntry = () => import('@/views/device/salesEntry')
const bindingCode = () => import('@/views/device/bindingCode')
const commissioning = () => import('@/views/device/commissioning')
const realTime = () => import('@/views/efficiency/realTime')
const meter = () => import('@/views/efficiency/meter')
const conditions = () => import('@/views/efficiency/conditions')
const energyData = () => import('@/views/efficiency/energyData')
const evaluation = () => import('@/views/efficiency/evaluation')
Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      redirect: '/Login',
      meta: {
        notRequireAuth: true
      }
    },
    {
      path: '/Login',
      name: 'Login',
      component: Login,
      meta: {
        notRequireAuth: true
      }
    },
    {
      path: '/Home',
      component: Home,
      meta: {
        notRequireAuth: true
      },
      children: [
        {
          path: '/',
          redirect: 'Workbench',
          meta: {
            notRequireAuth: true
          }
        },
        {
          path: 'Workbench',
          name: 'Workbench',
          component: Workbench,
          meta: {
            notRequireAuth: true
          }
        },
        {
          path: 'User',
          name: 'User',
          component: User,
          meta: {
            notRequireAuth: true
          }
        },
        {
          path: 'Scatterplot',
          name: 'Scatterplot',
          component: Scatterplot,
          meta: {
            notRequireAuth: true
          }
        },
        {
          path: 'Aggregategraph',
          name: 'Aggregategraph',
          component: Aggregategraph,
          meta: {
            notRequireAuth: true
          }
        },
        {
          path: 'division',
          name: 'division',
          component: division,
          meta: {
            notRequireAuth: true
          }
        },
        {
          path: 'protocol',
          name: 'protocol',
          component: protocol,
          meta: {
            notRequireAuth: true
          }
        },
        {
          path: 'contract',
          name: 'contract',
          component: contract,
          meta: {
            notRequireAuth: true
          }
        },
        {
          path: 'salesEntry',
          name: 'salesEntry',
          component: salesEntry,
          meta: {
            notRequireAuth: true
          }
        },
        {
          path: 'bindingCode',
          name: 'bindingCode',
          component: bindingCode,
          meta: {
            notRequireAuth: true
          }
        },
        {
          path: 'commissioning',
          name: 'commissioning',
          component: commissioning,
          meta: {
            notRequireAuth: true
          }
        },
        {
          path: 'realTime',
          name: 'realTime',
          component: realTime,
          meta: {
            notRequireAuth: true
          }
        },
        {
          path: 'meter',
          name: 'meter',
          component: meter,
          meta: {
            notRequireAuth: true
          }
        },
        {
          path: 'conditions',
          name: 'conditions',
          component: conditions,
          meta: {
            notRequireAuth: true
          }
        },
        {
          path: 'energyData',
          name: 'energyData',
          component: energyData,
          meta: {
            notRequireAuth: true
          }
        },
        {
          path: 'evaluation',
          name: 'evaluation',
          component: evaluation,
          meta: {
            notRequireAuth: true
          }
        }
      ]
    }
  ]
})
